home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d15 / infop141.arc / PAGE_13.PAS < prev    next >
Pascal/Delphi Source File  |  1990-12-07  |  6KB  |  236 lines

  1. procedure page_13;
  2. type
  3.   iotbltype = record
  4.                 spclfunc: byte;
  5.                 devtype: byte;
  6.                 devattr: word;
  7.                 cylcount: word;
  8.                 medtype: byte;
  9.                 bpsec: word;
  10.                 secpclus: byte;
  11.                 resvsec: word;
  12.                 fats: byte;
  13.                 rootentries: word;
  14.                 numsecs: word;
  15.                 meddescr: byte;
  16.                 secpfat: word;
  17.                 secptrk: word;
  18.                 numheads: word;
  19.                 numhidden: longint;
  20.                 largesec: longint;
  21.                 reserved: array[$19..$1E] of byte;
  22.               end;
  23.  
  24. var
  25.   i : $00..$2B;
  26.   xbyte : byte;
  27.   xchar : char;
  28.   xFCB : array[$00..$2B] of byte;
  29.   xlong : longint;
  30.   xstring : string;
  31.   xword1 : word;
  32.   xword2 : word;
  33.   xword3, xword4, xword5: word;
  34.   iotable: iotbltype;
  35.   saveX, saveY: byte;
  36.  
  37.   begin
  38.   caption2('LASTDRIVE');
  39.   drvname(lastdrv - 1);
  40.   writeln;
  41.   caption2('Logical drives');
  42.   with regs do
  43.     begin
  44.     for xchar:='A' to 'Z' do
  45.       begin
  46.       AH:=$0E;
  47.       DL:=ord(xchar) - ord('A');
  48.       MSDOS(regs);
  49.       AH:=$19;
  50.       MSDOS(regs);
  51.       if AL = DL then
  52.         drvname(AL)
  53.       end;
  54.     writeln;
  55.     AH:=$0E;
  56.     DL:=currdrv;
  57.     MSDOS(regs)
  58.     end;
  59.   caption2('Diskette drives');
  60.   if equip and $0001 = $0001 then
  61.     writeln(1 + equip and $00C0 shr 6)
  62.   else
  63.     writeln(0);
  64.   xword1:=longint(intvec[$1E]) shr 16;
  65.   xword2:=longint(intvec[$1E]) and $0000FFFF;
  66.   caption3('Sectors/track');
  67.   writeln(mem[xword1 : xword2 + 4]);
  68.   caption3('Bytes/sector');
  69.   writeln(mem[xword1 : xword2 + 3] shl 8);
  70.   caption3('On time (ms)');
  71.   writeln(125 * mem[xword1 : xword2 + 10]);
  72.   caption3('Off time (s)');
  73.   writeln(longint(mem[xword1 : xword2 + 2]) shl 16 / tick1:0:1);
  74.   caption3('Head settle time (ms)');
  75.   writeln(mem[xword1 : xword2 + 9]);
  76.   caption1('  Single drive is now ');
  77.   xbyte:=mem[BIOSdseg : $0104];
  78.   if xbyte <= ord('Z') - ord('A') then
  79.     begin
  80.     drvname(xbyte);
  81.     writeln
  82.     end
  83.   else
  84.     if xbyte = $FF then
  85.       writeln('N/A')
  86.     else
  87.       unknown('status', xbyte, 2);
  88. (*  Byte 12:12 p.178  *)
  89.   caption2('Current drive and path');
  90.   getdir(0, xstring);
  91.   writeln(xstring);
  92.   with regs do
  93.     begin
  94.     AH:=$52;
  95.     MsDos(regs);
  96.     if (osmajor = 3) and (osminor = 0) then
  97.       begin
  98.       xword1:=MemW[ES:BX + $19];
  99.       xword2:=MemW[ES:BX + $17]
  100.       end
  101.     else
  102.       begin
  103.       xword1:=MemW[ES:BX + $18];
  104.       xword2:=MemW[ES:BX + $16]
  105.       end;
  106.     if osmajor = 4 then
  107.       xword5:=$58
  108.     else
  109.       xword5:=$51;
  110.     xword3:=xword2 + (xword5 * currdrv);
  111.     caption3('Drive type is');
  112.     case MemW[xword1:xword3 + $43] shr 14 of
  113.       0: Writeln('invalid');
  114.       1: Writeln('physical');
  115.       2: Writeln('network');
  116.       3: Writeln('Installable File System')
  117.     end;
  118.     if (osmajor >= 4) or ((osmajor = 3) and (osminor >= 20)) then
  119.       with regs do
  120.         begin
  121.         AH:=$44;
  122.         AL:=$0D;
  123.         BL:=0;
  124.         CH:=8;
  125.         CL:=$60;
  126.         DS:=Seg(iotable);
  127.         DX:=Ofs(iotable);
  128.         MsDos(regs);
  129.         if Flags and FCarry = 0 then
  130.           with iotable do
  131.             begin
  132.             caption3('removable');
  133.             if devattr and 1 = 0 then
  134.               Write('yes')
  135.             else
  136.               Write('no');
  137.             caption3('door lock');
  138.             yesorno(devattr and 2 = 2);
  139.             end
  140.         end;
  141.     caption3('JOIN''d ');
  142.     if MemW[xword1:xword3 + $43] and $2000 = $2000 then
  143.       begin
  144.       Write('yes');
  145.       caption3('actually');
  146.       xword4:=xword3;
  147.       while Mem[xword1:xword4] <> 0 do
  148.         begin
  149.         Write(Chr(Mem[xword1:xword4]));
  150.         Inc(xword4)
  151.         end;
  152.       Writeln;
  153.       end
  154.     else
  155.       Writeln('no');
  156.     caption3('SUBST''d');
  157.     if MemW[xword1:xword3 + $43] and $1000 = $1000 then
  158.       begin
  159.       Write('yes');
  160.       caption3('actually');
  161.       xword4:=xword3;
  162.       while Mem[xword1:xword4] <> 0 do
  163.         begin
  164.         Write(Chr(Mem[xword1:xword4]));
  165.         Inc(xword4)
  166.         end;
  167.       Writeln;
  168.       end
  169.     else
  170.       Writeln('no')
  171.     end;
  172.   caption3('Volume label');
  173.   for i:=$00 to $2B do
  174.     xFCB[i]:=$00;
  175.   xFCB[$00]:=$FF;         (* extended FCB *)
  176.   xFCB[$06]:=$08;         (* volume ID attribute *)
  177.   for i:=$08 to $12 do
  178.     xFCB[i]:=ord('?');
  179.   with regs do
  180.     begin
  181.     AH:=$11;
  182.     DS:=seg(xFCB);
  183.     DX:=ofs(xFCB);
  184.     MSDOS(regs);
  185.     case AL of
  186.       $00 : begin
  187.             AH:=$2F;
  188.             MSDOS(regs);
  189.             i:=$08;
  190.             xchar:=char(mem[ES : BX + i]);
  191.             while (i <= $12) and (xchar > #0) do
  192.               begin
  193.               write(showchar(xchar));
  194.               inc(i);
  195.               xchar:=char(mem[ES : BX + i])
  196.               end;
  197.             writeln
  198.             end;
  199.       $FF : writeln('(none)')
  200.     else
  201.       unknown('status', AL, 2)
  202.     end {case}
  203.     end;
  204.   with regs do
  205.     begin
  206.     saveX:=WhereX;
  207.     saveY:=WhereY;
  208.     TextColor(LightRed+Blink);
  209.     Write('  *retrieving information*');
  210.     AH:=$1B;
  211.     MSDOS(regs);
  212.     GotoXY(saveX, saveY);
  213.     Write('                          ');
  214.     GotoXY(saveX, saveY);
  215.     media(mem[DS : BX], AL);
  216.     caption3('Clusters');
  217.     writeln(DX);
  218.     caption3('Sectors/cluster');
  219.     writeln(AL);
  220.     caption3('Bytes/sector');
  221.     writeln(CX)
  222.     end;
  223.   caption3('Total space (bytes)');
  224.   xlong:=disksize(0);
  225.   if xlong <> -1 then
  226.     writeln(xlong : 8)
  227.   else
  228.     writeln('(invalid drive)');
  229.   caption3('Free space (bytes) ');
  230.   xlong:=diskfree(0);
  231.   if xlong <> -1 then
  232.     write(xlong : 8)
  233.   else
  234.     write('(invalid drive)')
  235. end;
  236.